using System;
using System.Web.UI;
using Framework.Library.Utilities;
using Framework.Library.Components.Security;

namespace Framework.Module.Logging.Admin.UserControls
{
    public partial class SelecteDate : AuthenticatedControl
    {
        public DateTime GetCurrentDate()
        {
            DateTime retVal = new DateTime(ConvertUtility.ToInt32(dropYear.SelectedValue), ConvertUtility.ToInt32(dropMonth.SelectedValue), ConvertUtility.ToInt32(dropDay.SelectedValue));
            return retVal;
        }

        public void SetDate(DateTime date)
        {
            MiscUtility.FillIndex(dropDay, 1, 31, date.Day);
            MiscUtility.FillIndex(dropMonth, 1, 12, date.Month);
            MiscUtility.FillIndex(dropYear, 2000, 2020, date.Year);
        }
    }
}